package com.gurun.camera.device.bean;

import com.danale.player.listener.MediaState;
import com.danale.sdk.platform.constant.device.OnlineType;
import com.danale.sdk.platform.constant.device.ProductType;

import java.util.List;

public class SingleDevice extends VideoDevice {

    private MediaState mVideoState;
    private MediaState mAudioState;
    private MediaState mTalkState;
    private MediaState mRecordState;

    private SingleDevice(){

    }

    @Override
    public MediaState getVideoState(int chan) {
        return mVideoState;
    }

    @Override
    public MediaState getAudioState(int chan) {
        return mAudioState;
    }

    @Override
    public MediaState getTalkState(int chan) {
        return mTalkState;
    }

    @Override
    public MediaState getRecordState(int chan) {
        return mRecordState;
    }

    @Override
    public void setVideoState(int chan, MediaState state) {
        this.mVideoState = state;
    }

    @Override
    public void setAudioState(int chan, MediaState state) {
        this.mAudioState = state;
    }

    @Override
    public void setTalkState(int chan, MediaState state) {
        this.mTalkState = state;
    }

    @Override
    public void setRecordState(int chan, MediaState state) {
        this.mRecordState = state;
    }

    public static class Builder{
        String device_id;
        List<ProductType> deviceType;
        int cur_chan;
        int total_chan;
        int aviliable_chan;
        OnlineType onlineType;
        private MediaState mVideoState = MediaState.IDLE;
        private MediaState mAudioState = MediaState.IDLE;
        private MediaState mTalkState = MediaState.IDLE;
        private MediaState mRecordState = MediaState.IDLE;

        public Builder(){

        }

        public Builder setDevice_id(String device_id) {
            this.device_id = device_id;
            return this;
        }

        public Builder setDeviceType(List<ProductType> deviceType) {
            this.deviceType = deviceType;
            return this;
        }

        public Builder setCur_chan(int cur_chan) {
            this.cur_chan = cur_chan;
            return this;
        }

        public Builder setTotal_chan(int total_chan) {
            this.total_chan = total_chan;
            return this;
        }

        public Builder setAviliable_chan(int aviliable_chan) {
            this.aviliable_chan = aviliable_chan;
            return this;
        }

        public Builder setOnlineType(OnlineType onlineType){
            this.onlineType = onlineType;
            return this;
        }

        public SingleDevice build(){
            SingleDevice singleDevice = new SingleDevice();
            singleDevice.deviceType = deviceType;
            singleDevice.device_id = device_id;
            singleDevice.avilable_chan = aviliable_chan;
            singleDevice.chan_num = cur_chan;
            singleDevice.total_chan = total_chan;
            singleDevice.onlineType = onlineType;
            singleDevice.mRecordState = mRecordState;
            singleDevice.mVideoState = mVideoState;
            singleDevice.mAudioState = mAudioState;
            singleDevice.mTalkState = mTalkState;
            return singleDevice;
        }

    }
}
